package com.cskaoyan.bean.data;

import com.cskaoyan.bean.MarketOrder;
import com.cskaoyan.bean.vo.UserVo;
import com.github.pagehelper.PageInfo;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author stone
 * @date 2022/04/06 10:13
 */

@NoArgsConstructor
@Data
public class OrderData<T> {
    private MarketOrder order;
    private List<T> orderGoods;
    private UserVo user;

    public static OrderData data(MarketOrder marketOrder, PageInfo pageInfo,  UserVo userVo) {
        OrderData data = new OrderData();
        data.setOrder(marketOrder);

        data.setOrderGoods(pageInfo.getList());
        data.setUser(userVo);
        return data;
    }
//    public static CommonData data(List list) {
//        CommonData data = new CommonData();
//        data.setList(list);
//        return data;
//    }
}
